package com.example.test17.model;

import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserInfoMapper {
    @Update("update  user_info set username=#{username},password=#{password} where id=#{id}")
    void update(UserInfo userInfo);

    @Select("select id,username,password,age,gender,phone,delete_flag as deleteFlag, create_time as" +
            "createTime,update_time as updateTime from user_info ")
    List<UserInfo> selectAll();
    @Select("select id,username,password,age,gender,phone,delete_flag ,create_time " +
            ",update_time from user_info ")

//    @Results(id = "BaseMap",value = {
//                    @Result(column ="delete_flag",property = "deleteFlag"),
//                    @Result(column ="create_time",property = "createTime"),
//                    @Result(column ="update_time",property = "updateTime")
//            })
    List<UserInfo> selectAll2();
    //@ResultMap("BaseMap")
    @Select("select * from user_info where delete_flag=0")
    List<UserInfo> selectAll3();
}
